<?php /* Smarty version Smarty-3.1.8, created on 2012-05-29 12:02:43
         compiled from "templates\index.tpl" */ ?>
<?php /*%%SmartyHeaderCode:49714fc489632c4202-77245011%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'f90be83b235fb03cc225b11607032e9ddd415899' => 
    array (
      0 => 'templates\\index.tpl',
      1 => 1338285761,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '49714fc489632c4202-77245011',
  'function' => 
  array (
    'tabela_sala' => 
    array (
      'parameter' => 
      array (
        'sala_kolumna' => 1,
      ),
      'compiled' => '',
    ),
  ),
  'version' => 'Smarty-3.1.8',
  'unifunc' => 'content_4fc489635f4726_56111164',
  'variables' => 
  array (
    'host' => 0,
    'system' => 0,
    'value' => 0,
    '_LOGGED' => 0,
    'logged_user_name' => 0,
    'komunikat' => 0,
    'nawig1' => 0,
    's1' => 0,
    'seans' => 0,
    'infoFilm' => 0,
    'sala_kolumna' => 0,
    'sala' => 0,
    'w' => 0,
    'numer' => 0,
    'rezerwacja_miejsce' => 0,
    'limit_rez' => 0,
    'filmy' => 0,
    'klient' => 0,
    'rez' => 0,
    'film' => 0,
  ),
  'has_nocache_code' => 0,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_4fc489635f4726_56111164')) {function content_4fc489635f4726_56111164($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_date_format')) include 'D:\\xampp\\htdocs\\ekino\\smarty\\plugins\\modifier.date_format.php';
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>Ekino</title>
	
	<style>
		body,html{margin:0;padding:0; font-family:Arial; font-size:90%;}
		ul{width:270px;}
		ul{list-style-type:none; margin-left:0; padding-left:0;}
		ul li{border-bottom:1px solid #e0e0e0;}
		ul li a{color:#aaa; text-decoration:none;}
		ul li a:hover{color:#bfbfbf;}
	</style>
	
	<base href="http://<?php echo $_smarty_tpl->tpl_vars['host']->value;?>
/">
	<link type="text/css" rel="stylesheet" href="../css/template.css">
	<script type="text/javascript" src="../js/jquery.js"></script>
	
	<script type="text/javascript" src="../js/jquery.printPage.js"></script>
	
	
	<?php  $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['value']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['system']->value->pobierz_wszystkie_js(); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value){
$_smarty_tpl->tpl_vars['value']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['value']->key;
?>
		<script type="text/javascript" src="./js/<?php echo $_smarty_tpl->tpl_vars['value']->value;?>
"></script>
	<?php } ?>		
	<script type="text/javascript" src="./js/jquery-ui-1.8.20.custom.min.js"></script>
	
	<?php  $_smarty_tpl->tpl_vars['value'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['value']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['system']->value->pobierz_wszystkie_css(); if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['value']->key => $_smarty_tpl->tpl_vars['value']->value){
$_smarty_tpl->tpl_vars['value']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['value']->key;
?>
		<link type="text/css" rel="stylesheet" href="./css/<?php echo $_smarty_tpl->tpl_vars['value']->value;?>
">
	<?php } ?>	
				<style>	
			.opened{
				background-color:#D6E01B;
				width:25px;
				height:30px;
				line-height:35px;
				text-align:center;
			}
			.closed{
				background-color:#DEDEDE;
				width:25px;
				height:35px;
				line-height:35px;
				text-align:center;
			}
			.zarezerwowane{
				background-color:red;
				width:25px;
				height:35px;
				line-height:35px;
				text-align:center;
			}
		</style></head>
<body>	
	<div style="margin:0 auto; width:1024px;">
		<div style="background:#eee; width:100%; height:100px; padding-top:10px;">
			<div style="float:left; margin-left:10px; padding-right:10px; display:block;">
				<a href="./index.php" ><img src="./images/logo2.png" alt="" width="80"/></a>
			</div>
			<div style="margin:10px; text-align:right; padding:4px; background:#fff;">
				<?php if ($_smarty_tpl->tpl_vars['_LOGGED']->value){?>
					<a href="./logout.php" alt="" />Wyloguj [<?php echo $_smarty_tpl->tpl_vars['logged_user_name']->value;?>
]</a>
				<?php }else{ ?>
					Nie jesteś zalogowany w systemie <a href="./" alt="" />Zaloguj się</a>
				<?php }?>
			</div>
			<div>
				<h1>Ekino - Panel kasjera</h1>
			</div>
		</div>
			<?php if (isset($_smarty_tpl->tpl_vars['komunikat']->value)){?>
				<div style="background:#1e1; border:1px solid #ddd;"><?php echo $_smarty_tpl->tpl_vars['komunikat']->value;?>
</div>
			<?php }?>
		<center>
			

		<?php if (!$_smarty_tpl->tpl_vars['_LOGGED']->value){?>
			<div style="margin:10px;">
				<div id="login">
				<form method="post" action="./">
					<div class="left">Użytkownik:</div><div><input type="text" name="username" /></div>
					<div class="left">Hasło:</div><div><input type="password" name="userpass" /></div>
					 <div class="submit"><input type="submit" value="Zaloguj się" name="submit" /></div>
				</form>
				</div>
			</div>
		<?php }else{ ?>
			
			<div style='width:723px; float:left; padding-left:5px;  height:18px; font-size:11px; background-color:#DEF7FF; text-align:left; line-height:18px; border:1px solid #eee; margin-top:5px; margin-bottom;5px; '> 
				<a href='./index.php' />Strona główna</a>
				<?php if (isset($_smarty_tpl->tpl_vars['nawig1']->value)){?>
				»
				<a href="./<?php echo $_smarty_tpl->tpl_vars['nawig1']->value['url'];?>
" /><?php echo $_smarty_tpl->tpl_vars['nawig1']->value['nazwa'];?>
</a>
				<?php }?>
			</div>
			<div style='width:100%; clear:both; height:5px;'></div>
			<?php if ($_smarty_tpl->tpl_vars['s1']->value=='sala'){?>
				<?php echo $_smarty_tpl->getSubTemplate ('./sala.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
			
			<?php }elseif($_smarty_tpl->tpl_vars['s1']->value=='seans'){?>
				<?php echo $_smarty_tpl->getSubTemplate ('./seans.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>
			
			<?php }elseif($_smarty_tpl->tpl_vars['s1']->value=='rezerwacja'){?>
				<?php if (strtotime($_smarty_tpl->tpl_vars['seans']->value['termin'])>strtotime('now')){?>
					<h1><?php echo $_smarty_tpl->tpl_vars['infoFilm']->value[0]['tytul'];?>
 - rezerwacja o <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['seans']->value['termin'],'%H:%M');?>
 z daty <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['seans']->value['termin'],'%d.%m');?>
</h1> 
					
					<?php if (!function_exists('smarty_template_function_tabela_sala')) {
    function smarty_template_function_tabela_sala($_smarty_tpl,$params) {
    $saved_tpl_vars = $_smarty_tpl->tpl_vars;
    foreach ($_smarty_tpl->smarty->template_functions['tabela_sala']['parameter'] as $key => $value) {$_smarty_tpl->tpl_vars[$key] = new Smarty_variable($value);};
    foreach ($params as $key => $value) {$_smarty_tpl->tpl_vars[$key] = new Smarty_variable($value);}?>
						<?php if ($_smarty_tpl->tpl_vars['sala_kolumna']->value!=$_smarty_tpl->tpl_vars['sala']->value['tablica']['sala_kolumna']){?>
							<?php smarty_template_function_tabela_sala($_smarty_tpl,array('sala_kolumna'=>($_smarty_tpl->tpl_vars['sala_kolumna']->value+1)));?>

							<tr>
								<?php $_smarty_tpl->tpl_vars['w'] = new Smarty_Variable;$_smarty_tpl->tpl_vars['w']->step = 1;$_smarty_tpl->tpl_vars['w']->total = (int)ceil(($_smarty_tpl->tpl_vars['w']->step > 0 ? $_smarty_tpl->tpl_vars['sala']->value['tablica']['sala_wiersz']+1 - (1) : 1-($_smarty_tpl->tpl_vars['sala']->value['tablica']['sala_wiersz'])+1)/abs($_smarty_tpl->tpl_vars['w']->step));
if ($_smarty_tpl->tpl_vars['w']->total > 0){
for ($_smarty_tpl->tpl_vars['w']->value = 1, $_smarty_tpl->tpl_vars['w']->iteration = 1;$_smarty_tpl->tpl_vars['w']->iteration <= $_smarty_tpl->tpl_vars['w']->total;$_smarty_tpl->tpl_vars['w']->value += $_smarty_tpl->tpl_vars['w']->step, $_smarty_tpl->tpl_vars['w']->iteration++){
$_smarty_tpl->tpl_vars['w']->first = $_smarty_tpl->tpl_vars['w']->iteration == 1;$_smarty_tpl->tpl_vars['w']->last = $_smarty_tpl->tpl_vars['w']->iteration == $_smarty_tpl->tpl_vars['w']->total;?>
									<?php $_smarty_tpl->tpl_vars['numer'] = new Smarty_variable(($_smarty_tpl->tpl_vars['sala_kolumna']->value-1)*$_smarty_tpl->tpl_vars['sala']->value['tablica']['sala_wiersz']+$_smarty_tpl->tpl_vars['w']->value, null, 0);?>
									
									<td>
									<?php if (in_array($_smarty_tpl->tpl_vars['numer']->value,$_smarty_tpl->tpl_vars['rezerwacja_miejsce']->value)){?><?php }elseif($_smarty_tpl->tpl_vars['sala']->value["tablica"][$_smarty_tpl->tpl_vars['numer']->value]=="o"){?>
										<?php if (!$_smarty_tpl->tpl_vars['limit_rez']->value){?><a href='./rezerwacja.php?seans_id=<?php echo $_smarty_tpl->tpl_vars['seans']->value['id_seans'];?>
&miejsce=<?php echo $_smarty_tpl->tpl_vars['numer']->value;?>
'><?php }?>
									<?php }?>
									<div class='<?php if (in_array($_smarty_tpl->tpl_vars['numer']->value,$_smarty_tpl->tpl_vars['rezerwacja_miejsce']->value)){?>zarezerwowane<?php }elseif($_smarty_tpl->tpl_vars['sala']->value["tablica"][$_smarty_tpl->tpl_vars['numer']->value]=="o"){?>opened<?php }else{ ?>closed<?php }?>'><b><?php echo $_smarty_tpl->tpl_vars['numer']->value;?>
</b><input type='hidden' name='<?php echo $_smarty_tpl->tpl_vars['numer']->value;?>
' value='<?php if ($_smarty_tpl->tpl_vars['sala']->value["tablica"][$_smarty_tpl->tpl_vars['numer']->value]=="o"){?>o<?php }else{ ?>c<?php }?>' />
									<?php if (in_array($_smarty_tpl->tpl_vars['numer']->value,$_smarty_tpl->tpl_vars['rezerwacja_miejsce']->value)){?><?php }elseif($_smarty_tpl->tpl_vars['sala']->value["tablica"][$_smarty_tpl->tpl_vars['numer']->value]=="o"){?>
										<?php if (!$_smarty_tpl->tpl_vars['limit_rez']->value){?></a><?php }?>
									<?php }?>
									</div></td>
								<?php }} ?>
							</tr>
						<?php }?>
					<?php $_smarty_tpl->tpl_vars = $saved_tpl_vars;}}?>

					<?php if ($_smarty_tpl->tpl_vars['limit_rez']->value){?><h2 style='color:red;'>Pan wystarczajaco zarezerwowal w roznych miejsc.</h2><?php }?>
					<table cellpadding="5" cellspacing="5" id="tablica_sala" style="min-height:200px; display:inline-block; min-width:200px; border:1px solid #eee;">
						<?php smarty_template_function_tabela_sala($_smarty_tpl,array());?>

					</table>

					<h2>Legenda</h2>
					<table style='width:100%;' border="1">
					<tr>
						<td style='line-height:35px;'><div class='opened' style='float:left;'></div> - <b>Wolny</b></td>
						<td style='line-height:35px;'><div class='closed' style='float:left;'></div> - <b>Uszkodzone krzeslo albo droga</b></td>
						<td style='line-height:35px;'><div class='zarezerwowane' style='float:left;'></div> - <b>Zarezerwowany</b></td>
					</tr>
					</table>
					<br />
				<?php }else{ ?>
					<h1>Termin uplynal sie.</h1>
				<?php }?>
				
			<?php }elseif($_smarty_tpl->tpl_vars['s1']->value=='rezerwacja-miejsce'){?>
				<?php if (strtotime($_smarty_tpl->tpl_vars['seans']->value['termin'])>strtotime('now')){?>
					<?php if (in_array($_smarty_tpl->tpl_vars['numer']->value,$_smarty_tpl->tpl_vars['rezerwacja_miejsce']->value)){?>
						<h1>Ktoś zajął tym miejscem.</h1>
					<?php }else{ ?>
						<h1><?php echo $_smarty_tpl->tpl_vars['infoFilm']->value[0]['tytul'];?>
 - rezerwacja o <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['seans']->value['termin'],'%H:%M');?>
 z daty <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['seans']->value['termin'],'%d.%m');?>
, numer miejsca - <?php echo $_smarty_tpl->tpl_vars['numer']->value;?>
</h1> 
						<?php if (!$_smarty_tpl->tpl_vars['_LOGGED']->value){?>
							<form action='./rezerwacja.php?seans_id=<?php echo $_smarty_tpl->tpl_vars['seans']->value['id_seans'];?>
&miejsce=<?php echo $_smarty_tpl->tpl_vars['numer']->value;?>
' method="post">
							
								<div style='float:left; width:200px;'>Imię : </div><input type='text' name='imie' value='' /><br />
								<div style='float:left; width:200px;'>Nazwisko: </div><input type='text' name='nazwisko' value='' /><br />
								<input type='submit' name='submit' value='Zarezerwuj' />
								
							</form>
						<?php }else{ ?>
							<form action='./rezerwacja.php?seans_id=<?php echo $_smarty_tpl->tpl_vars['seans']->value['id_seans'];?>
&miejsce=<?php echo $_smarty_tpl->tpl_vars['numer']->value;?>
' method="post">
								<input type='submit' name='submit' value='Zarezerwuj' />
							</form>
						<?php }?>
					<?php }?>
					
				<?php }else{ ?>
					<h1>Termin uplynal sie.</h1>
				<?php }?>
			<?php }elseif($_smarty_tpl->tpl_vars['s1']->value=='sprzedaj_bilet'){?>
				<h1>Sprzedaj bilet</h1>
				<form action="" method="post" >
					Generowany kod : <input type="text" name='search_kod' />
					<input type="submit" value="Wyszukaj" />
				</form>
				<br />	
			<!--
				<h1>Drukuj bilet</h1>
				<form action="" method="post" >
					Aktualne filmy : <select name='filmy'>
						<?php if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['k'])) unset($_smarty_tpl->tpl_vars['smarty']->value['section']['k']);
$_smarty_tpl->tpl_vars['smarty']->value['section']['k']['loop'] = is_array($_loop=$_smarty_tpl->tpl_vars['filmy']->value) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$_smarty_tpl->tpl_vars['smarty']->value['section']['k']['name'] = 'k';
$_smarty_tpl->tpl_vars['smarty']->value['section']['k']['show'] = true;
$_smarty_tpl->tpl_vars['smarty']->value['section']['k']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['loop'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['k']['step'] = 1;
$_smarty_tpl->tpl_vars['smarty']->value['section']['k']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['loop']-1;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['k']['show']) {
    $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['loop'];
    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['k']['total'] == 0)
        $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['show'] = false;
} else
    $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['total'] = 0;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['k']['show']):

            for ($_smarty_tpl->tpl_vars['smarty']->value['section']['k']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['iteration'] = 1;
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['total'];
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['iteration']++):
$_smarty_tpl->tpl_vars['smarty']->value['section']['k']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['iteration'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['k']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['k']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['k']['first']      = ($_smarty_tpl->tpl_vars['smarty']->value['section']['k']['iteration'] == 1);
$_smarty_tpl->tpl_vars['smarty']->value['section']['k']['last']       = ($_smarty_tpl->tpl_vars['smarty']->value['section']['k']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['k']['total']);
?>
							<option value='<?php echo $_smarty_tpl->tpl_vars['filmy']->value[$_smarty_tpl->getVariable('smarty')->value['section']['k']['index']]['id_film'];?>
'><?php echo $_smarty_tpl->tpl_vars['filmy']->value[$_smarty_tpl->getVariable('smarty')->value['section']['k']['index']]['tytul'];?>
</option>
						<?php endfor; endif; ?>
					</select> <br />

						
					</select> <br />
					<input type="submit" value="Wyszukaj" />
				</form>
				<br />	GRANDEK to TRAGEDIA
				-->
				
			<?php }elseif($_smarty_tpl->tpl_vars['s1']->value=='wstep_drukuj'){?>
			<div id="drukuj">
				<img src='../images/logo.png' style='float:left; margin-top:18px; margin-right:8px;' />
				<table>
				<tr>
				<?php if (count($_smarty_tpl->tpl_vars['klient']->value)){?>
						<td><b>Imie:</b><?php echo $_smarty_tpl->tpl_vars['klient']->value[0]['imie'];?>
 </td>
						<td><b>Nazwisko:</b> <?php echo $_smarty_tpl->tpl_vars['klient']->value[0]['nazwisko'];?>
 </td>
				<?php }else{ ?>
						<td><b>Imie:</b><?php echo $_smarty_tpl->tpl_vars['rez']->value['imie'];?>
 </td>
						<td><b>Nazwisko:</b> <?php echo $_smarty_tpl->tpl_vars['rez']->value['nazwisko'];?>
 </td>
				<?php }?>
				</tr>
				<tr><td colspan="2">||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||</td></tr>
				<tr><td><b>Sala:</b> #<?php echo $_smarty_tpl->tpl_vars['sala']->value[0]['numer'];?>
</td><td><b>Miejsce:</b> <?php echo $_smarty_tpl->tpl_vars['rez']->value['id_miejsce'];?>
</td></tr>
				<tr><td><b>Film:</b> <?php echo $_smarty_tpl->tpl_vars['film']->value[0]['tytul'];?>
</td><td> <b>Start:</b> <?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['seans']->value[0]['termin'],'%Y-%m-%d %H:%M');?>
</td></tr>
				</table>
				<br />
				<a id="click-drukuj" href="drukuj_bilet.php?rez_id=<?php echo $_smarty_tpl->tpl_vars['rez']->value['id_rezerwacja'];?>
">Drukuj bilet</a>
				<br /><br />
			</div>
			
			<script>
				$("#click-drukuj").printPage();
			</script>
			<?php }else{ ?>
				<div id="srodek" style="height: 100%; min-height: 100px;">
					<a href='./sprzedaj_bilet.php'>Sprzedaj bilet</a> |
					<a href='./seans.php'>Rezerwuj miejsce</a>
					<!--<a href='funkcje/modyfikuj-rezerwacje.php'>Modyfikuj rezerwacje</a>-->
					
					<div id="wyniki"></div>
				</div>
			<?php }?>
		<?php }?>

		</center>
		<div style="clear:both; width:100%; text-align:center; font-size:10px; background:#eee;">Copyright 2012 - <br />Maciej Pochroń, Adam Nowak, Leszek Rączka</div>
	</div>

</body>
</html<?php }} ?>